<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{:L('UPGRADE_WUKONG_CRM')}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="{:L('WUKONG_CRM')}">
    <link href="__PUBLIC__/css/bootstrap.min.css" rel="stylesheet">
	<link href="__PUBLIC__/css/jquery-ui-1.10.0.custom.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 20px;
        padding-bottom: 20px;
        background-color: #f5f5f5;
      }

      .install {
        max-width: 600px;
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
      .install input[type="text"],
      .install input[type="password"] {
        font-size: 16px;
        height: auto;
        padding: 7px 9px;
		margin:0;
      }
	  .install h3 {
		border-bottom:1px solid #e5e5e5;
	  }
	  .wukong {
	    margin-top:30px;
		padding-top:10px;
		border-top:1px solid #e5e5e5;		
	  }
	  .table td {border:0;}
	  .table td label{border:0;line-height:34px;}
	  .table td span{border:0;line-height:34px;color:#999999;}

    </style>
    <link href="__PUBLIC__/css/bootstrap-responsive.min.css" rel="stylesheet">
    <script type="text/javascript">
        var browserInfo = {browser:"", version: ""};
        var ua = navigator.userAgent.toLowerCase();
        if (window.ActiveXObject) {
            browserInfo.browser = "IE";
            browserInfo.version = ua.match(/msie ([\d.]+)/)[1];
            if(browserInfo.version <= 7){
                if(confirm("您的ie浏览器版本过低，建议使用chorme浏览器，\n点击【确定】转到下载页面")){}
                location.href = 'http://www.google.cn/intl/zh-CN/chrome/browser/';
            }
        }
    </script>
    <link rel="shortcut icon" href="__PUBLIC__/ico/favicon.png">
  </head>

  <body>
    <div class="container">
		<div class="install">
			<h3>{:L('WUKONG_CRM_DATABASE_UPGRADE')} </h3>			
			<p>{:L('UPGRADE_SYSTEM_FILES')}</p>
			<p>{:L('TO_UPGRADE_THE_DATABASE_FILE')}</p>
			<volist name="upgrade_list" id="upgrade">
			<p>{$upgrade}</p>
			</volist>
			<p><a class="btn btn-primary" id="process">{:L('CLICK_HERE_TO_UPGRADE')}</a></p>
			<div id="upgrade_process" class="hide">
				<p><span class="precent"></span></p>
				<div class="progress progress-striped active">
					<div class="bar" style="width: 0%;"></div>
				</div>
			</div>
			<div class="row-fluid wukong">
				<div class="span12">
					<p>{:L('WUKONG_CRM')} &copy; {:L('RUIQI_CULTURE')}</p>
					<p><small>
						<a href="http://www.5kcrm.com/" target="_blank">{:L('USE_THE_HELP')}</a>
						<span class="muted">&middot;</span>
						<a href="http://www.5kcrm.com/" target="_blank">{:L('TECHNICAL_SUPPORT')}</a>
						<span class="muted">&middot;</span>
						<a href="http://www.ccds24.com" target="_blank">{:L('CONTACT_US')}</a>
					</small></p>
				</div>
			</div>
		</div>
    </div>
    <script src="__PUBLIC__/js/jquery-1.9.0.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="__PUBLIC__/js/jquery-ui-1.10.0.custom.min.js" type="text/javascript"></script>
	<script type="text/javascript">
	$(function(){		
		function process(id) {
			$.get('{:U("install/upgradeProcess")}', {id:id}, function(data){
				$(".bar").css("width", data.info);
				$(".precent").html(data.info);
				if(data.info != '100%') {					
					process(data.data);
				} else {
					$(".progress").removeClass("active");
					$(".precent").append("{:L('TO_UPGRADE_SUCCESS')}<a href='{:U('user/login')}'>{:L('CLICK_HERE_TO_LOGIN')}</a>");
				}
			}, 'json');
		}
		
		$('#process').click( 
		function(){
			$(this).addClass('hide');
			$('#upgrade_process').removeClass('hide');
			process(0);
		}
	);
	});
	
	</script>
  </body>
</html>